﻿using IMark.DAO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IMark
{
    public partial class TinTuc : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<BAI_VIET> ltBaiViet = new List<BAI_VIET>();
            if(Request.QueryString["IDTacGia"]!=null)
            {
                long IDTacGia = long.Parse(Request.QueryString["IDTacGia"]);
                ltBaiViet = TinTucModels.LayBaiVietTheoTacGia(IDTacGia);
            }
            else if(Request.QueryString["IDLoaiBV"]!=null)
            {
                long IDLoaiBC = long.Parse(Request.QueryString["IDLoaiBV"]);
                ltBaiViet = TinTucModels.LayBaiVietTheoLoai(IDLoaiBC);
            }
            else
            {
                ltBaiViet = TinTucModels.LayTatCaBaiViet();
            }
            Repeater1.DataSource = ltBaiViet;
            Repeater1.DataBind();
        }
    }
}